# -*- coding: utf-8 -*-
import json

def getPersonMainList(request):
    #1数据
    request.cursor_standard.execute(request.formatSql('''
        select 
            person_main.*
        from standard.person_main
        where   person_id like '%${person_id}%'
        limit ${start} , ${rows} 
    '''))
    rows = request.cursor_standard.fetchall()
    #2页码
    request.cursor_standard.execute(request.formatSql('''
        select 
            count(*) as total
        from standard.person_main
        where  person_id like '%${person_id}%'
    '''))
    total = request.cursor_standard.fetchone()['total']
    return json.dumps({'rows':rows,'total':total}, ensure_ascii=False)